<%@ page language="java" contentType=
"text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" 
prefix="c" %>
<%@ taglib uri="/WEB-INF/tourAgencyTagLib.tld" 
prefix="tATL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>туристическое агентство ТУРАГЕНСТВО - все вещи своими именами</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">

function createArray(length)
{
 this.length = length;
 for( var i = 1; i<= length; i++)
  this[i] = null;
 return this;  
}
//                  *********************************************** Some Preparation Data ******************************************

var Entries ; // How many entries in the Database? Changes in SearchTag
var Separator = ";" ;      // Separator for the Data fields
var Fields = 12; // Number of DataFields
var iHotelName = 1;
var iCity = 2;
var iCountry = 3; // German ZIP Code
var iMeal = 4;
var iStar = 5;
var iDateTo = 6;
var iDateFrom = 7;
var iCityFrom = 8;
var iChildren = 9;
var iAdults = 10;
var iPrice = 11;
var iId = 12;

//  *********************************************** Type in your Data below *****************************************
<tATL:searchTag user="${user}"> </tATL:searchTag>
//                   ***************************************** End of Data Block ********************************************************
//                   ***************************************** Begin Common functions ************************************************

var LastMatch = 0; // Store Last Matched Data Index
function GetField(Entry,number) // Count begins with 1, f.e. GetField(Data[1] ,1) returns Walkowiak
{
 var Out = "";
 var FirstChar;
 var LastChar;

 FirstChar = 0;
 LastChar = Entry.indexOf(Separator) ;
 if (number == 1) 
 {
  Out += Entry.substring(FirstChar,LastChar); 
  return Out;
 }
 if (number == Fields)
 {
  Out+= Entry.substring(Entry.lastIndexOf(Separator) + 1,Entry.length);
  return Out;
 }

 for(var i =2; i <= number; i++)
 {
  FirstChar = LastChar + 1;
  LastChar = Entry.indexOf(Separator, FirstChar);
 }
 Out += Entry.substring(FirstChar,LastChar); 
 return Out;
}

function FindNext()
{ 
 var CompareWith = "";
 var String = "";
 arrayResultId="";
 for(var i = 1; i <=Data.length; i++)
 {  
	 var eql = true;
     for(var number = 1; number <=Fields; number++)
         {
          switch (number)
               {
                case 1:
                    String = document.SearchForm.Result1.value;
                break;
                case 2:
                    String = document.SearchForm.Result2.value;
                break;
                case 3:
                    String = document.SearchForm.Result3.value;
                break;
                case 4:
                    String = document.SearchForm.Result4.value;
                break;
                case 5:
                    String = document.SearchForm.Result5.value;
                break;
                case 6:
                    String = document.SearchForm.Result6.value;
                break;
                case 7:
                    String = document.SearchForm.Result7.value;
                break;
                case 8:
                    String = document.SearchForm.Result8.value;
                break;
                case 9:
                    String = document.SearchForm.Result9.value;
                break;
                case 10:
                    String = document.SearchForm.Result10.value;
                break;
                case 11:
                    String = document.SearchForm.Result11.value;
                break;
                case 12:
                    String = document.SearchForm.Result12.value;
                break;
                default:
        	    document.write("c");
           }
          
          var buf = GetField(Data[i],number);
          var bl = parseInt(buf.length);
          var sl = parseInt(String.length);

          
          if(number<11)
              {
                  if(bl > sl)
                    {
                      CompareWith = buf.substring(0,sl );
                    } else
                    {
                      CompareWith = buf;
                    }

                  String = String.toLowerCase();
                  CompareWith = CompareWith.toLowerCase();
                  if (CompareWith == String||String=="")
                    {
                    }else
                    {
                    	eql=false;
                    }
            
            }   
          else 
          {
              if(String!="")
                
                 if (number==11){
                     var k1 = parseInt(String);
                     var k2 = parseInt(GetField(Data[i],11));
                     if(k1>k2) eql=false;
                 }else{
                	 var k1 = parseInt(String);
                     var k2 = parseInt(GetField(Data[i],11));
                     if(k1<k2) eql=false;
                 }
          }   
     }
      if (eql==true)
          {
	         LastMatch = i;
	         Result.innerHTML=Result.innerHTML+"<div class=\"post1\"><div class=\"post\"><h1 class=\"title\">"+GetField(Data[i],1)+" "+GetField(Data[i],5)+","+GetField(Data[i],2)+","+GetField(Data[i],3)+
	     	"</h1><div class=\"entry\"><p><img src=\"img/img06.jpg\"alt=\"\" width=\"140\"height=\"125\"class=\"left\"/>"+GetField(Data[i],6)+GetField(Data[i],7)+
	         "<br/>"+GetField(Data[i],4)+"<br/></p><p>&nbsp;</p></div><div class=\"meta\"><p class=\"byline\">Posted on July 21, 2007</p><p class=\"links\"><a href="+
	         "\"jsp/viewtour.jsp?idTour="+(i-1)+"\"class=\"more\">Read more</a> <b>|</b> <a href=\"#\"class=\"comments\">Comments (32)</a></p></div></div></div>";
           
           }
     
 }
 LastMatch = 0;
 return 0; 
}

// ************************************************************* Custom functions for this document********************************
function ResetSearch()
{
 Result.innerHTML="";
 LastMatch = 0;
 for(var i = Fields; i >=1; i--)
 {
  document.SearchForm.elements[i-1].value = "";
 }
}



function TypeNext()
{
 Result.innerHTML="";
 var j = FindNext();
}

// -->
</script>
</head>
<body>
<!-- start header -->
<div id="header">
	<div id="menu">
		<ul>
			<li class="current_page_item"><a href="index.jsp">Homepage</a></li>
			<li><a href="#">Blogs</a></li>
			<li><a href="#">Photos</a></li>
			<li><a href="#">About</a></li>
			<li class="last"><a href="#">Contact</a></li>
			<tATL:authorisation user="${user}" pageFrom ="${\"/index.jsp\"}"> </tATL:authorisation>			
		</ul>
	</div>
</div>
<div id="logo-wrap">
<div id="logo">
	<h1><a href="#">ТУРАГЕНСТВО </a></h1>
	<h2> - все вещи своими именами</h2>
</div>
</div>
<!-- end header -->
<!-- start page -->
<div id="page">
	<!-- start content -->
	<div id="content">
	<div id="Result">
	</div>
	<tATL:tourPropositionTag> </tATL:tourPropositionTag>
		<div class="post">
			<h2 class="title">Lorem Ipsum Dolor Volutpat</h2>
			<div class="entry">
				<p>Curabitur tellus. Phasellus tellus turpis, iaculis in, faucibus lobortis, posuere in, lorem. Donec a ante. Donec neque purus, adipiscing id, eleifend a, cursus vel, odio. Vivamus varius justo sit amet leo. Morbi sed libero. Vestibulum blandit augue at mi. Praesent fermentum lectus eget diam. Nam cursus, orci sit amet porttitor iaculis, ipsum massa aliquet nulla, non elementum mi elit a mauris. In hac habitasse platea.</p>
				<p>Vestibulum blandit augue at mi. Praesent fermentum lectus eget diam. Nam cursus, orci sit amet porttitor iaculis, ipsum massa aliquet nulla, non elementum mi elit a mauris. In hac habitasse platea.</p>
			</div>
			<div class="meta">
				<p class="byline">Posted on July 18, 2007 byFreeCssTemplates</p>
				<p class="links"><a href="#" class="more">Read full article</a> <b>|</b> <a href="#" class="comments">Comments (32)</a></p>
			</div>
		</div>
	</div>
	<!-- end content -->
	<!-- start sidebar -->
	<div id="sidebar">
	 
		<ul>
		   <tATL:adminPanelTag user="${user}"></tATL:adminPanelTag>
			<li id="search">
				<h2>Search</h2>

<form name="SearchForm" onsubmit="TypeNext();return false">
  <p>
  Hotel:<br/><input type="text" size="15" name="Result1" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  City:<br/><input type="text" size="15" name="Result2" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Country:<br/><input type="text" size="15" name="Result3" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Meal:<br/><input type="text" size="15" name="Result4" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Star:<br/><input type="text" size="15" name="Result5" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  DateTo:<br/><input type="text" size="15" name="Result6" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  DateFrom:<br/><input type="text" size="15" name="Result7" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  CityFrom:<br/><input type="text" size="15" name="Result8" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Children:<br/><input type="text" size="15" name="Result9" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Adults:<br/><input type="text" size="15" name="Result10" rows="1" cols="20" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/><br/>
  Price:<br/>from <input type="text" size="6" name="Result11" rows="1" cols="8" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/>
  to <input type="text" size="6" name="Result12" rows="1" cols="8" style="font-family: MS Sans Serif; font-size: 8; background-color:#E1FFEA; color: rgb(255,0,0);"/>$</p>
   <p>
  <input type="submit" name="FindNext" value="Find" style="font-family: MS Sans Serif; font-size: 8pt;"/>
  <input type="reset" name="NewSearch" value="NewSearch" onclick="ResetSearch();" style="font-family: ms Sans Serif; font-size: 8pt;"/><br/>
  </p>
</form>
     
			</li>
			
			<li>
				<h2>Volutpat Dolore</h2>
				<ul>
					<li><a href="#">Nec metus sed donec</a></li>
					<li><a href="#">Magna lacus bibendum mauris</a></li>
					<li><a href="#">Velit semper nisi molestie</a></li>
					<li><a href="#">Eget tempor eget nonummy</a></li>
					<li><a href="#">Nec metus sed donec</a></li>
					<li><a href="#">Magna lacus bibendum mauris</a></li>
					<li><a href="#">Velit semper nisi molestie</a></li>
				</ul>
			</li>
		</ul>
	</div>
	<!-- end sidebar -->
	<div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
	<div id="footer-wrap">
	<p id="legal">(c) 2007 YourSite. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a> | <a href="http://free-templates.ru">free-templates.ru</a>. </p>
	</div>
</div>
<!-- end footer -->
</body>
</html>
